package com.example.springbootproject.controller;


import com.example.springbootproject.service.MyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;
import java.time.LocalDate;
import java.util.Timer;

@RestController("/my")
public class MyController {

    @Autowired
    private MyService myService;

    @PostMapping("/test")
    public String test(@RequestBody String str){
        return myService.test(str);
    }

    public static void main(String[] args) {
//        System.out.println("567890-");
//        System.out.println("start time "+System.currentTimeMillis());
//        System.out.println(2%2);
//        System.out.println("end time: " + System.currentTimeMillis());
//
//
//        System.out.println("start time "+System.currentTimeMillis());
//        System.out.println(2&1);
//        System.out.println("end time: " + System.currentTimeMillis());

        int i=1;
        i = i++;
        int j = i++;
        int k = i+ ++i*i++;
        System.out.println("i=" + i);
        System.out.println("j=" + j);
        System.out.println("k=" + k);


    }


    @RequestMapping("/hello")
    public String hello(HttpSession session){
        session.setAttribute("lss","lss");
        System.out.println("hello");
        return "hello test";
    }

}
